<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改班级老师关系')" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-relation-edit" th:object="${classTeacherRelation}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">学科：</label>
                <div class="col-sm-8">
                    <select name="subject" th:with="type=${@dict.getType('sc_subject_type')}" required class="form-control m-b selectpicker" th:field="*{subject}">
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">老师id：</label>
                <div class="col-sm-8">
                    <select name="teacherId" id="answerStatus" class="form-control m-b selectpicker" th:with="type=${@teacher.getTeacherList()}" required data-live-search="true" th:field="*{teacherId}" >
                        <option value="">请选择</option>
                        <option th:each="teacher : ${type}" th:text="${teacher.userName}" th:value="${teacher.userId}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script type="text/javascript">
        var prefix = ctx + "school/relation";
        $("#form-relation-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-relation-edit').serialize());
            }
        }
    </script>
</body>
</html>